package csp;

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class CSP2013122 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        scanner.close();
        List<Integer> number = Arrays.stream(input.replace("-", "").split("")).map(CSP2013122::parseInt).collect(Collectors.toList());
        int result = 0;
        for (int i = 1; i < 10; i++) {
            result += i * number.get(i - 1);
        }

        if (result % 11 == number.get(9)) {
            System.out.println("Right");
        } else {
            String group1 = String.valueOf(number.get(1) * 100 + number.get(2) * 10 + number.get(3));
            String group2 = String.valueOf(number.get(4) * 10000 + number.get(5) * 1000 + number.get(6) * 100 + number.get(7) * 10 + number.get(8));
            String group3 = result % 11 == 10 ? "X" : String.valueOf(result % 11);
            System.out.println(number.get(0) + "-" + group1 + "-" + group2 + "-" + group3);
        }
    }

    public static int parseInt(String x) {
        if (!x.equals("X")) {
            return Integer.parseInt(x);
        } else {
            return 10;
        }
    }
}
